/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.random;

/**
 * Class <code>RandomGenerator</code> 是一个随机数发生器，可以产生一个随机数.
 * 所有的方法实现线程安全。
 * 不过，如果你有大量从多个线程在同一时间产生一个随机数的表现是依赖于随机数发生器的执行情况。
 * 
 * @author jrwz
 * @version 2012-7-13下午03:52:29
 * @see com.lineage.server.random
 * @since JDK1.7
 */
public interface RandomGenerator {
    /**
     * 返回一个<code>int</code>型的伪随机数.
     * 
     * @return 类型为<code>int</code>的伪随机数
     */
    int nextInt();

    /**
     * 使用随机数生成器的序列，从0（0，但是，包括不包括指定值）值范围返回一个<code>int</code>类型的伪随机数.
     * 
     * @param n
     *            - 值
     * 
     * @throws IllegalArgumentException
     *             n 为负
     * @return 基于随机数发生器、(含0)从(不包括n)此范围、<code>int</code>型的下一个伪随机数
     * */
    int nextInt(int n);
}
